package com.zhan.ielts.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.zhan.frame.core.dao.impl.BaseDaoImpl;
import com.zhan.frame.core.exception.DaoException;
import com.zhan.ielts.dao.CompositionJjForecastDao;
import com.zhan.ielts.domain.CompositionJjForecast;
import com.zhan.ielts.domain.vo.CompositionJjForecastVo;

@Repository
public class CompositionJjForecastDaoImpl extends BaseDaoImpl<CompositionJjForecast> implements
		CompositionJjForecastDao {

	@Override
	public List<CompositionJjForecast> selectLatest(CompositionJjForecastVo entity) {
		return sqlSessionTemplate.selectList(getSqlName("selectLatestOnes"), entity);
	}

	@Override
	public String selectTitle() {
		try {
			return sqlSessionTemplate.selectOne(getSqlName("selectTitle"));
		} catch (Exception e) {
			throw new DaoException(String.format("查询对象总数出错！语句：%s", getSqlName("selectTitle")), e);
		}
	}

}
